﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EventMgrLib;
using SmartMotion.Core;

namespace ClassLibrary1
{
    public class Class1
    {

        public string Name { get; set; } = "abcd";
        public int Age { get; set; } = 1234;

        public string FName;
        public int FAge;
        public static string NameStatic { get; set; }

        public int IntField;
        public string StringField;
        public static int IntStaticField;


        public Class1()
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish("无参构造函数");
        }
        public Class1(string name)
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish("参数为name的构造函数");
        }
            
        public Class1(int age)
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish("参数为age的构造函数");
        }

        public Class1(string name,int age)
        {
            Name = name;
            Age = age;
            FName = name;
            FAge = age;
            EventMgr.Ins.GetEvent<DebugMessage>().Publish("参数为name,age的构造函数");
        }
        public static Class1 GetClass1Object()
        {
            return new Class1();
        }

        public static void Test1()
        {
            Console.WriteLine("Test1");
        }
        public static void Test1(string abc)
        {
            Console.WriteLine("Test1");
        }
        public static void Test2()
        {
            Console.WriteLine("Test2");
        }

        public static void ShowMessage(string message)
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish(message);
        }

        public static void ShowAge(int age) 
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish($"年龄是:{age}");
        }

        public static void ShowBool(bool bTrue)
        {
            EventMgr.Ins.GetEvent<DebugMessage>().Publish($"真假:{bTrue}");
        }

        public static string GetName()
        {
       
            return "张三";
        }

        public string 非静态有参数(string name)   
        {
            return name;
        }

        

    }
}
